using NUnit.Framework;
using TMS.SocialNews.Core.Classes;

namespace TMS.SocialNews.Tests
{
    [TestFixture]
    public class UserTests
    {
        [Test]
        public void DefaultConstructorSetsNull()
        {
            Users user = new Users();
            Assert.IsEmpty(user.UserName);
            Assert.IsEmpty(user.Password);
            Assert.IsEmpty(user.EmailAddress);
        }

        [Test]
        public void OverridenConstructorSetsProperties()
        {
            Users user = new Users("JohnDoe", "Password", "john@domain.com");
            Assert.AreEqual("JohnDoe", user.UserName);
            Assert.AreEqual("Password", user.Password);
            Assert.AreEqual("john@domain.com", user.EmailAddress);
        }

        [Test]
        public void SettingPasswordPropertyShouldReturnHash()
        {
            Users user = new Users();
            user.Password = "sha1";
            Assert.AreEqual("4UTbDnNUkEInuAJoL+cdEZxgzX8=", user.Password);
        }
    }
}